package cn.mdmbct.spring.starter.douyin.common.properties.storage;

import lombok.Data;
import lombok.Getter;

import java.io.Serializable;

/**
 * Jedis配置
 *
 * @author mdmbct  mdmbct@outlook.com
 * @date 2021/3/19 20:47
 * @modified mdmbct
 * @since 1.0
 */
@Getter
public class JedisProperties implements Serializable {

    public static final String PREFIX = "dy.open.storage.jedis";

    private static final long serialVersionUID = 2657979524435365671L;

    /**
     * 主机地址.
     */
    private String host = "127.0.0.1";

    /**
     * 端口号.
     */
    private int port = 6379;

    /**
     * 密码.
     */
    private String password;

    /**
     * 超时.
     */
    private int timeout = 3000;

    /**
     * 数据库.
     */
    private int database = 0;

    /**
     * 最大活动对象数
     */
    private Integer maxTotal;

    /**
     * 最大能够保持idel状态的对象数
     */
    private Integer maxIdle;

    /**
     * 当池内没有返回对象时，最大等待时间   -1没有限制
     */
    private Integer maxWaitMillis;

    private Integer minIdle;

    public void setHost(String host) {
        this.host = host;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public void setDatabase(int database) {
        this.database = database;
    }

    public void setMaxTotal(Integer maxTotal) {
        this.maxTotal = maxTotal;
    }

    public void setMaxIdle(Integer maxIdle) {
        this.maxIdle = maxIdle;
    }

    public void setMaxWaitMillis(Integer maxWaitMillis) {
        this.maxWaitMillis = maxWaitMillis;
    }

    public void setMinIdle(Integer minIdle) {
        this.minIdle = minIdle;
    }
}
